home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Apple Location Manager / ALMInterfaces / LocationManager.p < prev    next >
Encoding:
Text File  |  1997-05-19  |  6.0 KB  |  210 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        LocationManager.p
  3.  
  4.      Contains:    LocationManager (manange preferences for different physical locations)
  5.  
  6.      Version:    System 7.6
  7.                  Package:    Location Manager SDK 1.0
  8.  
  9.      Copyright:    © 1984-1997 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT LocationManager;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __LOCATIONMANAGER__}
  28. {$SETC __LOCATIONMANAGER__ := 1}
  29.  
  30. {$I+}
  31. {$SETC LocationManagerIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __APPLEEVENTS__}
  35. {$I AppleEvents.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __COMPONENTS__}
  38. {$I Components.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __PROCESSES__}
  41. {$I Processes.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __DIALOGS__}
  44. {$I Dialogs.p}
  45. {$ENDC}
  46.  
  47. {$PUSH}
  48. {$ALIGN MAC68K}
  49. {$LibExport+}
  50.  
  51. {
  52. --------------------------------------------------------------------------------------
  53.  Location token
  54. --------------------------------------------------------------------------------------
  55. }
  56.  
  57. TYPE
  58.     ALMToken = ^LONGINT;
  59. {
  60. --------------------------------------------------------------------------------------
  61.  Public error codes 
  62. --------------------------------------------------------------------------------------
  63. }
  64.  
  65. CONST
  66.     ALMInternalErr                = -30049;
  67.     ALMLocationNotFound            = -30048;
  68.     ALMNoSuchModuleErr            = -30047;
  69.     ALMModuleCommunicationErr    = -30046;
  70.     ALMDuplicateModuleErr        = -30045;
  71.     ALMInstallationErr            = -30044;
  72.     ALMDeferSwitchErr            = -30043;
  73.     ALMLastErr                    = -30043;
  74.     ALMLastAllocatedErrNum        = -30030;
  75.  
  76. {
  77. --------------------------------------------------------------------------------------
  78.  Various parameters 
  79. --------------------------------------------------------------------------------------
  80. }
  81. { ALMConfirmName reports these results }
  82.     ALMConfirmRenameConfig        = 1;
  83.     ALMConfirmReplaceConfig        = 2;
  84.  
  85. {  ALMSwitchToLocation masks }
  86.     kALMDefaultSwitchFlags        = 0;
  87.     kALMDontShowStatusWindow    = 1;
  88.     kALMSignalViaAE                = 2;
  89.  
  90.     kALMLocationNameMaxLen        = 31;
  91.     kALMMaxLocations            = 16;                            {  arbitrary limit.  enforced by LocatioManager. }
  92.     kALMNoLocationIndex            = -1;                            {  index and token for the 'off' location }
  93.     kALMNoLocationToken            = -1;
  94.     kAELocationNotice            = 'walk';                        {  Notification AEvent sent to apps when location changes }
  95.     kALMFileCreator                = 'walk';                        {  creator type of LocatioManager files }
  96.  
  97. {  gestalt selectors }
  98.     gestaltALMVers                = 'walk';
  99.     gestaltALMAttr                = 'trip';
  100.     gestaltALMPresent            = 0;
  101.  
  102. {
  103. --------------------------------------------------------------------------------------
  104.  Location-switched notification proc
  105. --------------------------------------------------------------------------------------
  106. }
  107.  
  108. TYPE
  109.     ALMNotificationProcPtr = ProcPtr;  { PROCEDURE ALMNotification(VAR theEvent: AppleEvent); }
  110.  
  111.     ALMNotificationUPP = UniversalProcPtr;
  112.  
  113. CONST
  114.     uppALMNotificationProcInfo = $000000C0;
  115.  
  116. FUNCTION NewALMNotificationProc(userRoutine: ALMNotificationProcPtr): ALMNotificationUPP;
  117.     {$IFC NOT GENERATINGCFM }
  118.     INLINE $2E9F;
  119.     {$ENDC}
  120.  
  121. PROCEDURE CallALMNotificationProc(VAR theEvent: AppleEvent; userRoutine: ALMNotificationUPP);
  122.     {$IFC NOT GENERATINGCFM}
  123.     INLINE $205F, $4E90;
  124.     {$ENDC}
  125. {
  126. --------------------------------------------------------------------------------------
  127.  Dispatched trap API
  128. --------------------------------------------------------------------------------------
  129. }
  130. FUNCTION ALMGetCurrentLocation(VAR index: SInt16; VAR token: ALMToken; VAR name: Str31): OSErr;
  131.     {$IFC NOT GENERATINGCFM}
  132.     INLINE $303C, $0600, $AAA4;
  133.     {$ENDC}
  134. FUNCTION ALMGetIndLocation(index: SInt16; VAR token: ALMToken; VAR name: Str31): OSErr;
  135.     {$IFC NOT GENERATINGCFM}
  136.     INLINE $303C, $0501, $AAA4;
  137.     {$ENDC}
  138. FUNCTION ALMCountLocations(VAR nLocations: SInt16): OSErr;
  139.     {$IFC NOT GENERATINGCFM}
  140.     INLINE $303C, $0202, $AAA4;
  141.     {$ENDC}
  142. FUNCTION ALMSwitchToLocation(newLocation: ALMToken; switchFlags: SInt32): OSErr;
  143.     {$IFC NOT GENERATINGCFM}
  144.     INLINE $303C, $0403, $AAA4;
  145.     {$ENDC}
  146. FUNCTION ALMRegisterNotifyProc(notificationProc: ALMNotificationUPP; {CONST}VAR whichPSN: ProcessSerialNumber): OSErr;
  147.     {$IFC NOT GENERATINGCFM}
  148.     INLINE $303C, $0404, $AAA4;
  149.     {$ENDC}
  150. FUNCTION ALMRemoveNotifyProc(notificationProc: ALMNotificationUPP; {CONST}VAR whichPSN: ProcessSerialNumber): OSErr;
  151.     {$IFC NOT GENERATINGCFM}
  152.     INLINE $303C, $0405, $AAA4;
  153.     {$ENDC}
  154. FUNCTION ALMConfirmName(msg: ConstStr255Param; VAR configName: Str255; VAR choice: SInt16; filter: ModalFilterUPP): OSErr;
  155.     {$IFC NOT GENERATINGCFM}
  156.     INLINE $303C, $0806, $AAA4;
  157.     {$ENDC}
  158. {
  159. --------------------------------------------------------------------------------------
  160.  Location Manager User Module API
  161. --------------------------------------------------------------------------------------
  162. }
  163.  
  164. CONST
  165.     kALMComponentType            = 'walk';                        {  These masks apply to the "flags" field in the ComponentDescription record.  }
  166.     kALMMultiplePerLocation        = 1;                            {  this module can be added more than once to a location }
  167.                                                                 {  this module's settings' descriptions can change even  }
  168.     kALMDescriptionGetsStale    = 2;                            {  when the setting didn't change. }
  169.  
  170.  
  171. TYPE
  172.     ALMComponentFlagsEnum                = UInt32;
  173.     ALMRebootFlags                        = UInt32;
  174.  
  175. CONST
  176.                                                                 {  These are the possible values of ALMRebootFlags to be returned in the 'flags' parameter of ALMSetCurrent()  }
  177.     kALMNoChange                = 0;
  178.     kALMAvailableNow            = 1;
  179.     kALMFinderRestart            = 2;
  180.     kALMProcesses                = 3;
  181.     kALMExtensions                = 4;
  182.     kALMWarmBoot                = 5;
  183.     kALMColdBoot                = 6;
  184.     kALMShutdown                = 7;
  185.  
  186.     kALMScriptInfoVersion        = 2;
  187.  
  188.  
  189. TYPE
  190.     ALMScriptMgrInfoPtr = ^ALMScriptMgrInfo;
  191.     ALMScriptMgrInfo = RECORD
  192.         version:                SInt16;                                    {  set to kALMScriptInfoVersion }
  193.         scriptCode:                SInt16;
  194.         regionCode:                SInt16;
  195.         langCode:                SInt16;
  196.         fontNum:                SInt16;
  197.         fontSize:                SInt16;
  198.     END;
  199.  
  200. {$ALIGN RESET}
  201. {$POP}
  202.  
  203. {$SETC UsingIncludes := LocationManagerIncludes}
  204.  
  205. {$ENDC} {__LOCATIONMANAGER__}
  206.  
  207. {$IFC NOT UsingIncludes}
  208.  END.
  209. {$ENDC}
  210.